package transform;

import java.io.*;

public class TransformTest2 {
    public static void main(String[] args) {
        // 得到文件原始字符

        try {
            OutputStream os = new FileOutputStream("C:\\Users\\zjd\\IdeaProjects\\java\\src\\itheima.07.txt");
            // 转换为想要的字符集形式
            Writer osw = new OutputStreamWriter(os, "GBK");
            // 包装成字符缓冲流
            BufferedWriter bw = new BufferedWriter(osw);

            bw.write("我是中国人abc");
            bw.write("我爱你中固123");
            bw.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
